<?php
/**
 * Created by PhpStorm.
 * User: zhan
 * Date: 2018/11/5  16:37
 */
namespace app\api\logic;
use app\api\BaseModel;
use think\Db;

class Code extends  BaseModel
{

    //检测参数是否已传
    protected $ParameterDetection = [
        'codeEdit'=>['codename','type','introduction','']
    ];

    //代码列表
    public function codeList()
    {
        $page = isset($this->requestData['page'])?$this->requestData['page']:'1';
        $where = [];
        $data = db('code')->where($where)->page($page,'15')->order('id desc')->select();
        $result['list'] = $data;
        return $result;
    }

    //代码编辑
    public function codeEdit()
    {

    }
}
